<template>
	<view class="">
		<view class="Topbg">


		</view>

		<view class="move">
			<view class="mode">
				<view style="margin:0 auto 40rpx auto;width: 140rpx;">
					<u-image src="/static/golden.png" width="140" height="60"></u-image>
				</view>
				<view class="u-flex u-row-between u-margin-top-80">
					<view class="u-flex">
						<u-image :src="imagesurl+'/images/my_5.png'" width="60" height="60"></u-image>
						<text class="moneny u-margin-left-20">{{moneny}}</text>
					</view>
					<view class="u-flex">
						<view class="btn red" @click="go">兑换</view>
						
			    	</view>
				</view>
			</view>
	
		
			
			<view v-for="(item,index) in list" :key="index" class="List u-flex u-border-bottom u-padding-20">
				<view :class="Number(item.number)<0?'tred':'tblue'">{{item.number}}</view>
			
				<view>
					<view>{{item.remark}}</view>
					<view style="color: #999;font-size: 20rpx;margin-top: 10rpx;">{{item.createTime}}</view>
				</view>
			</view>
		
			
			<u-loadmore :status="status" />
			
		</view>
		
		
		
		
		

	</view>
</template>

<script>

	import payway from '../../common/wxpay.js';
	import url from '@/common/baseUrl.js';

	export default {

		data() {
			return {
				imagesurl: url.imageUrl,
				moneny: "",
				status: 'loadmore',
				page: 1,
			
				
				list:[]
			
			
			}
		},
		onLoad() {
			this.jiazai()
			
		},
		onShow() {
			this.information()
		},
		onReachBottom() {
			if (this.status == 'nomore') {
		
			} else {
				this.jiazai()
			}
		
		},
		methods: {
			go(){
			   uni.navigateTo({
			   	url:"./gloden_detail"
			   })
			},
	        change(index) {
				this.current = index;
				this.page=1;
				this.jiazai()
			}, 
			jiazai(){
				this.$u.post('/api/Financial/gold', {
				
				   page:this.page,
				}, {}).then(res => {
				   var resList = res.data;
				   if (this.page == 1) {
				   	this.list = []
				   }
				   if (resList.length > 9) {
				   	this.status = 'loadmore'
				   	this.page = this.page + 1
				   } else {
				   	this.status = 'nomore'
				   }
				   this.list = this.list.concat(resList)
				   this.loading = false
				   
										 
				}).catch(err => {})
			},
			information(){
				this.$u.post('/api/user/information', {
					
				}, {}).then(res => {
					
					this.moneny=res.data.gold
				}).catch(err => {})
			}
			
		
		}
	}
</script>
<style lang="scss">
	@import 'common.css';
</style>
